package com.itheima.homework04;

public class CalculatorDemo {
    public static void main(String[] args) {
        useCalculator(new Calculator() {
            @Override
            public int calc(int a, int b) {
                return a+b;
            }
        });
        useCalculator((a,b) -> a+b);
    }

    private static void useCalculator(Calculator calculator) {
        int c = calculator.calc(10,8);
        System.out.println(c);
    }
}
